package cn.heyige.backend.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

@Data
@Schema(description = "提示词模板相关数据传输对象")
public class PromptTemplateDto {
    
    @Schema(description = "添加模板请求")
    @Setter
    @Getter
    public static class AddRequest {
        @Schema(description = "标题", example = "写作助手", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotBlank(message = "标题不能为空")
        @Size(max = 100, message = "标题长度不能超过100")
        private String title;
        
        @Schema(description = "描述", example = "帮助用户进行写作创作的模板")
        @Size(max = 500, message = "描述长度不能超过500")
        private String description;
        
        @Schema(description = "分类", example = "写作", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotBlank(message = "分类不能为空")
        @Size(max = 50, message = "分类长度不能超过50")
        private String category;

        @Schema(description = "模板内容", example = "请帮我写一篇关于{主题}的文章", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotBlank(message = "内容不能为空")
        private String content;

        @Schema(description = "排序顺序", example = "0")
        private Integer sortOrder = 0;
    }
    
    @Schema(description = "更新模板请求")
    @Setter
    @Getter
    public static class UpdateRequest {
        @Schema(description = "标题", example = "写作助手")
        @Size(max = 100, message = "标题长度不能超过100")
        private String title;
        
        @Schema(description = "描述", example = "帮助用户进行写作创作的模板")
        @Size(max = 500, message = "描述长度不能超过500")
        private String description;
        
        @Schema(description = "分类", example = "写作")
        @Size(max = 50, message = "分类长度不能超过50")
        private String category;

        @Schema(description = "模板内容", example = "请帮我写一篇关于{主题}的文章")
        private String content;

        @Schema(description = "排序顺序", example = "0")
        private Integer sortOrder;
    }
    
    @Schema(description = "模板响应")
    @Setter
    @Getter
    public static class TemplateResponse {
        @Schema(description = "模板ID", example = "1")
        private Integer id;
        
        @Schema(description = "标题", example = "写作助手")
        private String title;
        
        @Schema(description = "描述", example = "帮助用户进行写作创作的模板")
        private String description;
        
        @Schema(description = "分类", example = "写作")
        private String category;

        @Schema(description = "模板内容", example = "请帮我写一篇关于{主题}的文章")
        private String content;
        
        @Schema(description = "排序顺序", example = "0")
        private Integer sortOrder;
        
        @Schema(description = "创建时间", example = "2024-01-01T10:00:00")
        private LocalDateTime createTime;
        
        @Schema(description = "更新时间", example = "2024-01-01T12:00:00")
        private LocalDateTime updateTime;

    }
}